import axios from 'axios';

const WEB_URL = 'http://27.150.175.210:8082/v1';
const WEB_URL1 = 'http://27.150.175.210:8082/v2';
const util = {
  // 请求封装
  post(url, params) {
    return new Promise((resolve, reject) => {
      axios
        .post(WEB_URL + url, params, {})
        .then(res => {
          resolve(res);
        })
        .catch(err => {
          reject(err);
        });
    });
  },
  // 请求封装1
  post1(url, params) {
    return new Promise((resolve, reject) => {
      axios
        .get(WEB_URL1 + url)
        .then(res => {
          resolve(res);
        })
        .catch(err => {
          reject(err);
        });
    });
  }
};
export default util;
